/*
* BankService
*
* r1
*
* GNU General Public License v3.0
*/

package com.acme.bankapp.service.bank;

import com.acme.bankapp.domain.bank.*;

public class BankService {

	public void addClient(Bank bank, Client client) {
		Client[] clients = bank.getClients();
		
		for(int i = 0; i < clients.length; i++) {
			if(clients[i] == null) {
				clients[i] = client;
				break;
			}
		}
	}
	
	public void printMaximumAmountToWithdraw(Bank bank) {
		for(Client client : bank.getClients()) {
			if(client != null) {
				System.out.println(client.getClientSalutation() + "'s maximum amount to withdraw: " + client.getAccounts()[0].maximumAmountToWithdraw());
			}
		}
	}
	
}
